package com.zz;

import com.spring.BeanDefination;
import com.spring.ZzAplicationContext;
import com.zz.service.UserService;
import com.zz.service.UserServiceImpl;

public class Test {
    public static void main(String[] args) throws Exception {
        ZzAplicationContext zzAplicationContext=new ZzAplicationContext(AppConfig.class);
        BeanDefination beanDefination=ZzAplicationContext.beandefinationMaps.get("userservice");
        String scope=beanDefination.getScope();
        System.out.println("scope域为："+scope);
        System.out.println("单例池中有无"+ZzAplicationContext.singletonMap.containsKey("userservice"));

        UserService userService= (UserService) zzAplicationContext.getBean("userservice");
        userService.test();//先执行代理逻辑，再执行自己业务内的方法

    }
}
